<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>函数</title>
    <script>
      // 创建函数
      function MyLog(msg) {
        console.log("================ " + msg + " ================");
      }

      // 调用函数
      MyLog("testing function");

      // 匿名函数
      var func = function () {
        console.log("匿名函数");
      };
      func();

      // 任意多参数
      function ManyParameter() {
        for (var i = 0; i < arguments.length; i++) {
          console.log(arguments[i]);
        }
      }

      function ArrowheadFunc() {
        let demo = () => {};
        demo();
      }

      // 箭头函数
      ManyParameter(1, 2, 3, 4);
    </script>
  </head>
  <body></body>
</html>
